package cn.itcast.day05.demo02;

public class Demo04StringConvert {
    public static void main(String[] args) {
        char[] charArray = "Hello World".toCharArray();
        System.out.println(charArray);
        for (int i = 0; i < charArray.length; i++) {
            System.out.println(charArray[i]);
        }
        System.out.println("=========================");
        byte[] bytes = "abc".getBytes();
        System.out.println(bytes);
        for (int i = 0; i < bytes.length; i++) {
            System.out.println(bytes[i]);
        }
        System.out.println("================");
        String str1="Hello World";
        String str2=str1.replace("World","Java");
        System.out.println(str1);
        System.out.println(str2);
    }
}
